<?php
	/* Pagina inicial do glossario no curso */

	session_start();

	include("/var/www/html/vivencias/conexaoBD.php");
	include("/var/www/html/vivencias/verificaRecursosAtivados.php");
	include("/var/www/html/vivencias/wikiVerificaEdicao.php");

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Experi&ecirc;ncias do Processo de Adoecimento</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="vivencias.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">

function MM_openBrWindow(theURL,winName,features) { //v2.0

	window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->//-->
</script>
</head>
<body onLoad="MM_preloadImages('imagens/stt_blogs2.jpg','imagens/stt_salaR2.jpg','imagens/stt_wiki2.jpg')">
<div align="center">
  <table width="1000" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="10%" align="left" valign="top"><strong><img src="imagens/logo.jpg" width="66" height="53"></strong></td>
                  <td width="90%"><strong><img src="imagens/tit1.jpg" width="612" height="28"></strong></td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr align="left" valign="middle">
                  <td colspan="3" class="nomecurso"><?php echo $_SESSION['nomeCurso'];?></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td><strong><a href="index.php"><img src="imagens/sair.gif" width="33" height="19" border="0"></a></strong></td>
                </tr>
                <tr align="left" valign="middle">
                  <td width="25%">&nbsp;</td>
                  <td width="22%">&nbsp;</td>
                  <td width="52%">&nbsp;</td>
                  <td width="0%">&nbsp;</td>
                  <td width="0%">&nbsp;</td>
                  <td width="1%">&nbsp;</td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td><table width="96%" border="0" cellspacing="0" cellpadding="0">
                <tr align="left" valign="top">
		<!--Somente o professor pode visualizar gerenciamento.-->
		<?php if(($_SESSION['idTipoUsuario']=="0")||($_SESSION['idTipoUsuario']=="1")||($_SESSION['idTipoUsuario']=="5")){?>
                  <td width="3%" background="imagens/bar_fnd_8.jpg" bgcolor="EBF4F9"><strong><a href="relatorios.htm"><img src="imagens/mn_8.jpg" width="23" height="161" border="0"></a></strong></td>
		<?php } ?>
                  <td width="3%" background="imagens/bar_fnd_7.jpg"><strong><a href="info.php"><img src="imagens/mn_7.jpg" width="23" height="137" border="0"></a></strong></td>
                  <td width="3%" background="imagens/bar_fnd_6.jpg"><strong><a href="esppess.php"><img src="imagens/mn_6.jpg" width="23" height="156" border="0"></a></strong></td>
                  <td width="3%" background="imagens/bar_fnd_5.jpg"><strong><a href="comunicacao.php"><img src="imagens/mn_5.jpg" width="23" height="146" border="0"></a></strong></td>
                  <td width="3%" background="imagens/bar_fnd_4.jpg"><strong><a href="banco.php"><img src="imagens/mn_4.jpg" width="23" height="219" border="0"></a></strong></td>
                  <td width="3%" background="imagens/bar_fnd_3.jpg"><strong><a href="ferramentasTrabalho.php"><img src="imagens/mn_3.jpg" width="23" height="249" border="0"></a></strong></td>
                  <td width="71%" align="center" bgcolor="F5FEFF">
<table width="816" border="0" cellpadding="0" cellspacing="0">
                      <tr align="left" valign="top">

		<?php
			if($objetoN->salaReuniao){
				if($_SESSION['idTipoUsuario'] != '3'){
		?>
                        <td width="10" height="21"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                        <td width="129"><a href="salaR.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('salareuniao','','imagens/stt_salaR2.jpg',1)"><img src="imagens/stt_salaR1.jpg" name="salareuniao" width="129" height="21" border="0"></a></td>

		<?php }} ?>

		<?php
			if(($objetoN->wiki && $wiki)||($objetoN->wiki && $_SESSION['idTipoUsuario']=="0")||($objetoN->wiki && $_SESSION['idTipoUsuario']=="1")||($objetoN->wiki && $_SESSION['idTipoUsuario']=="5")){

		?>
                        <td width="10"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                        <td width="56"><a href="wiki.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('wiki','','imagens/stt_wiki2.jpg',1)"><img src="imagens/stt_wiki1.jpg" name="wiki" width="41" height="21" border="0"></a></td>
		<?php } ?>

                        <td width="10"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                        <td width="91"><img src="imagens/stt_gloss2.jpg" width="78" height="21"></td>
		<?php
			if( ($objetoN->blog && $blog) || ($objetoN->blog && $_SESSION['idTipoUsuario']=="0") || ($objetoN->blog && $_SESSION['idTipoUsuario']=="1") || ($objetoN->blog && $_SESSION['idTipoUsuario']=="5") ){
		?>

                        <td width="10"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                        <td width="48"><a href="blogs.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('blogs1','','imagens/stt_blogs2.jpg',1)"><img src="imagens/stt_blogs1.jpg" name="blogs1" width="48" height="21" border="0" id="blogs1"></a></td>

		<? } ?>
                        <td width="234"><img src="imagens/pix_branco.gif" width="230" height="5"></td>
                      </tr>
                      <tr align="center" valign="middle">
                           <td height="2" colspan="9"><img src="imagens/pix_cor2d.gif" width="810" height="2"></td>
                      </tr>
                      <tr align="center" valign="top">
                        <td colspan="9"><table width="560" border="0" cellpadding="0" cellspacing="0">
                            <tr><!--
                              <td width="1%" height="20"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                              <td width="6%">&nbsp;</td>
                              <td width="1%"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                              <td width="11%">&nbsp;</td>
                              <td width="1%"><img src="imagens/pix_branco.gif" width="10" height="5"></td>
                              <td width="23%">&nbsp;</td>
                              <td width="57%" colspan="10">&nbsp;</td>-->
                            </tr>
                          </table></td>
                      </tr>
                    </table>
                    <br>
                    <table width="95%" border="0" cellpadding="5" cellspacing="1">
	              <tr>
                         <td align="right" valign="middle" class="miudo"><a href="javascript:void();" onclick="javascript:window.open('duvidaG1.htm','Janela','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=600,height=400');"><img src="imagens/duvida8.gif" width="24" height="24" border="0"></a></td></tr>
                      <tr>
                        <td align="center" valign="middle" bgcolor="d3f2f5"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
			    
                            <tr align="center" bgcolor="#38708F" class="texttab">
                              <td align="left" valign="top" bgcolor="9dd1d7">
                                <span class="ativo">Gloss&aacute;rio</span></td>
                            </tr>
                            <tr align="center" bgcolor="#38708F" class="texttab">
                              <td align="left" valign="top" bgcolor="d3f2f5" class="texto2"><strong><a href="#A" class="texto2">A</a>
                                <a href="#B" class="texto2">B</a> <a href="#C" class="texto2">C</a>
                                <a href="#D" class="texto2">D</a> <a href="#E" class="texto2">E</a>
                                <a href="#F" class="texto2">F</a> <a href="#G" class="texto2">G</a>
                                <a href="#H" class="texto2">H</a> <a href="#I" class="texto2">I</a>
                                <a href="#J" class="texto2">J</a> <a href="#K" class="texto2">K</a>
                                <a href="#L" class="texto2">L</a> <a href="#M" class="texto2">M</a>
                                <a href="#N" class="texto2">N</a> <a href="#O" class="texto2">O</a>
                                <a href="#P" class="texto2">P</a> <a href="#Q" class="texto2">Q</a>
                                <a href="#R" class="texto2">R</a> <a href="#S" class="texto2">S</a>
                                <a href="#T" class="texto2">T</a> <a href="#U" class="texto2">U</a>
                                <a href="#V" class="texto2">V</a> <a href="#W" class="texto2">W</a>
                                <a href="#X" class="texto2">X</a> <a href="#Y" class="texto2">Y</a>
                                <a href="#Z" class="texto2">Z</a></strong></td>
                            </tr>
                           <form action="excluiTermoGlossario.php" method="post" name="formExcluiTermoGlossario">
                            <tr align="center" bgcolor="#38708F" class="texttab">
                              <td valign="top" bgcolor="d3f2f5"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
                                  <tr align="center" valign="middle" bgcolor="f4f1fc" class="texto">
				   					 <?php if(($glossario)||($_SESSION['idTipoUsuario']=="0")||($_SESSION['idTipoUsuario']=="5")){ ?>
                                    	<td colspan="2" align="right" bgcolor="d3f2f5">
                                    		<p align="left" class="texto">
				
												<a href="javascript:void(0)" class="texto2" onclick="javascript:window.open('inserirT.php','teste2','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=700,height=500');" span>
                       								 <input type="button" name="Submit2" value="Inserir termo" />
                    							</a> 
                    							<?php if( ($_SESSION['idTipoUsuario'] == "0") || ($_SESSION['idTipoUsuario'] == "1") || ($_SESSION['idTipoUsuario'] == "5") ){ ?>
                    								<input type="submit" name="btnExcluirTermo" value="Excluir termo" />
                    							<?php } ?>
				   						 	</p>
				   						</td>
				    				<?php } ?>
                                  </tr>
						
									<!-- Exibe a lista dos termos do glossário daquele curso. -->
									<?php
										$query = "SELECT * FROM glossarios WHERE idCurso='".$_SESSION['idCurso']."' ORDER BY termo";
										$resultado = mysql_query($query,$conexao);
										while($objeto = mysql_fetch_object($resultado)){
									?>
									
                                  <tr align="center" valign="middle" bgcolor="f4f1fc" class="texto">
                                  		<?php if( ($_SESSION['idTipoUsuario']=="0") || ($_SESSION['idTipoUsuario']=="1") || ($_SESSION['idTipoUsuario']=="5") ){?>
	                                    	<td align="left" width="5%" bgcolor="F5FEFF">
	                                    		<input type="checkbox" name="cbExcluir[]" value=<?php echo $objeto->idGlossario;?>>
	                                    	</td>
                                    	<?php } ?>
                                    		<td align="left" bgcolor="F5FEFF">
                                    			<a name="<?php echo strtoupper(substr($objeto->termo,0,1));?>"></a>
                                    			<a href="javascript:void(0)" class="texto2" onClick="javascript:window.open('termoGloss.php?idGlossario=<?php echo $objeto->idGlossario;?>','Janela','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=700,height=500');" span><strong><?php echo $objeto->termo;}?></strong></a>
                                    		</td>						
                                  </tr>
                                </table></td>
                            </tr>
                          </form>
                          </table></td>
                      </tr>
                      <tr>
                        <td><p><br>
                          </p></td>
                      </tr>
                    </table>
                    <p><strong> </strong></p>
                    <p align="center">&nbsp;</p>
                    </td>
                  <td width="3%" align="right" background="imagens/bar_fnd_2.jpg"><strong><a href="conteudo.php"><img src="imagens/mn_2.jpg" width="23" height="113" border="0"></a></strong></td>
                  <td width="8%" align="right" background="imagens/bar_fnd_1.jpg" bgcolor="F1FEF9">
                    <p><strong><a href="principal.php"><img src="imagens/mn_1.jpg" width="23" height="103" border="0"></a></strong></p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</div>
</body>
</html>
